<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <div :style='{border:borderStyle,width:widthStyle,height:heightStyle}'></div>
        <div :style='objStyle'></div>
        <button @click='a'>切换</button>
    </div>
</body>
<script src="./V/vue.js"></script>
<script>
    var vm = new Vue({
        el:'#app',
        data:{
            borderStyle:'1px solid blue',
            widthStyle:'100px',
            heightStyle:'200px',
            objStyle:{
                border:'1px solid red',
                width:'100px',
                height:'200px'
            },
        },methods:{
            a:function(){
                this.heightStyle='100px'
            }
        }
    })
</script>
</html>